home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / notes210.zip / FG-2-10.TXT < prev   
Text File  |  1992-01-31  |  37KB  |  1,208 lines

  1.  
  2.                                 Release Notes
  3.  
  4.                              Fastgraph (tm) v2.10
  5.                           Fastgraph/Light (tm) v1.10
  6.  
  7.                                January 31, 1992
  8.  
  9.  
  10.  
  11.                              Ted Gruber Software
  12.                                  PO Box 13408
  13.                              Las Vegas, NV  89112
  14.  
  15.                              (702) 735-1980 voice
  16.                               (702) 735-4603 FAX
  17.                               (702) 796-7134 BBS
  18.                                 72000,1642 CIS
  19.  
  20.                  Copyright (c) 1991,1992 Ted Gruber Software.
  21.                              All Rights Reserved.
  22.  
  23.  
  24.  
  25. ------------------------------------------------------------------------------
  26.                                  Introduction
  27. ------------------------------------------------------------------------------
  28.  
  29. Fastgraph 2.10 offers two new video modes, new routines, new utilities, and
  30. optimizations and improvements to many existing routines.  Some of the more
  31. important new features are:
  32.  
  33.         * Support for "Mode X" (320x240 256-color VGA graphics) and its
  34.           320x480 scan-doubled extension
  35.         * Video page resizing that allows smooth, flicker-free panning
  36.         * PCX display and creation functions
  37.         * Logical video pages in conventional, expanded, or extended memory
  38.         * An improved mode-specific bit map format in video modes 13 to 18
  39.         * Routines to read or write a block of video DAC registers
  40.         * Suspension and resumption of asynchronous music
  41.         * 43-line and 50-line text mode extensions
  42.         * Turbo Pascal and Power C support
  43.         * Updated User's Guide (now with an index) and Reference Manual
  44.  
  45. To illustrate the Fastgraph routines introduced in version 2.10, we've added
  46. new example programs.  The addition of the new examples has resulted in the
  47. resequencing of some of the examples from previous versions of Fastgraph.  The
  48. correspondence between the old and new example numbers is:
  49.  
  50.         FG 2.00/2.01 example numbers    FG 2.10 example numbers
  51.         ----------------------------    -----------------------
  52.         3-5 to 3-8                      3-6 to 3-9
  53.         5-12 to 5-14                    5-14 to 5-16
  54.         6-11 to 6-14                    6-12 to 6-15
  55.         7-4 to 7-10                     7-5 to 7-11
  56.         9-15 to 9-20                    9-16 to 9-21
  57.         9-21 to 9-26                    9-23 to 9-28
  58.         
  59. ------------------------------------------------------------------------------
  60.                                New video modes
  61. ------------------------------------------------------------------------------
  62.  
  63. Fastgraph 2.10 offers two new extended VGA graphics video modes, as summarized
  64. in the following table:
  65.  
  66.       Mode                    No. of    Page Size    Physical    Virtual
  67.       Number    Resolution    Colors    in Bytes     Pages       Pages
  68.       ------    ----------    ------    ---------    --------    -------
  69.         22      320 x 240     256/256K     76,800       3+       none
  70.         23      320 x 480     256/256K    153,600       1+       none
  71.  
  72. Mode 22 is the so-called "mode X" recently described by Michael Abrash in
  73. Dr. Dobb's Journal.  To our knowledge, Fastgraph is the first commercial
  74. graphics library to support this video mode.  Mode 22 is appealing because
  75. it offers 256 colors, has a 1:1 aspect ratio (i.e., pixels are square), and
  76. is very fast.
  77.  
  78. The "+" following the number of physical pages means there is an additional
  79. partial video page available.  In mode 22, there are three full physical
  80. pages (numbered 0 to 2) plus one partial page of 80 pixel rows (page 3).  In
  81. mode 23, there is one full page (page 0) plus one partial page of 320 pixel
  82. rows (page 1).  You can safely use the partial pages as long as you don't
  83. reference pixel rows beyond the last available row.  Also, you cannot make
  84. the partial page the visual page.
  85.  
  86. The size of hardware characters in modes 22 and 23 is 8 x 8.  This means
  87. there are 30 character rows in mode 22 and 60 rows in mode 23.
  88.  
  89. ------------------------------------------------------------------------------
  90.                                 Logical pages
  91. ------------------------------------------------------------------------------
  92.  
  93. In addition to physical and virtual video pages, Fastgraph 2.10 includes
  94. logical video pages.  Logical pages can be created in any video mode and
  95. can exist in conventional memory, expanded memory (EMS), or extended memory
  96. (XMS).  However, they are not as versatile as physical or virtual pages
  97. because the only operations you can perform with logical pages are:
  98.  
  99.         * Copy an entire physical or virtual page to a logical page
  100.         * Copy an entire logical page to a physical or virtual page
  101.         * Copy an entire logical page to another logical page
  102.  
  103. Three new functions (fg_alloccms, fg_allocems, and fg_allocxms) are provided
  104. for creating logical pages in conventional memory, expanded memory, and
  105. extended memory, respectively.  The fg_freepage function has been modified
  106. to release all three types of logical pages.  Other new Fastgraph functions
  107. that deal with logical pages are summarized in the following section.
  108.  
  109. ------------------------------------------------------------------------------
  110.              New mode-specific bit map format for modes 13 to 18
  111. ------------------------------------------------------------------------------
  112.  
  113. The native EGA and VGA graphics modes (modes 13-18) now use a different format
  114. for mode-specific bit maps.  In previous versions of Fastgraph, you had to
  115. call the fg_drwimage or fg_getimage routines once for each color in the image
  116. in these video modes.  This is no longer true because these routines allow
  117. storage of all colors in a single bit map, just as the other video modes do.
  118.  
  119. The new bit map format is identical to that of mode 9 (see pages 127-129 in
  120. the Fastgraph User's Guide).  The old format is still supported (it was the
  121. same as the mode-independent format in these video modes), but you must now
  122. use fg_drawmap and fg_getmap instead of fg_drwimage and fg_getimage.
  123.  
  124. It is our policy to maintain downward compatibility between all versions of
  125. Fastgraph.  However, we feel the benefits offered by Fastgraph's new EGA and
  126. VGA mode-specific bit map format far outweigh the fact that it is different
  127. from eariler versions (especially since the fg_drawmap and fg_getmap functions
  128. offer the same bit map format as the previous versions of fg_drwimage and
  129. fg_getimage).
  130.  
  131. ------------------------------------------------------------------------------
  132.                                 New functions
  133. ------------------------------------------------------------------------------
  134.  
  135. FG_ALLOCCMS
  136.  
  137. Prototype
  138.  
  139.    int fg_alloccms (int page_number);
  140.  
  141. Description
  142.  
  143.    The fg_alloccms routine creates a logical page in conventional memory.
  144.    The amount of memory required depends on the current video mode and
  145.    video buffer dimensions.
  146.  
  147. Parameters
  148.  
  149.    page_number is the number by which the logical page will be referenced.
  150.    It must be between 1 and 63.
  151.  
  152. Return value
  153.  
  154.     0 = logical page created in conventional memory
  155.    -2 = invalid page number
  156.    -3 = page already created, or page exists as a physical or virtual page
  157.    -4 = insufficient expanded memory to create the page
  158.  
  159. Restrictions
  160.  
  161.    This routine has no effect if page_number references a physical or
  162.    virtual video page.
  163.  
  164.    The only function you can perform with logical pages is copying one
  165.    entire page to another (with fg_copypage).
  166.  
  167. See also
  168.  
  169.    fg_allocems, fg_allocxms, fg_copypage, fg_freepage
  170.  
  171. Examples
  172.  
  173.    8-9
  174.  
  175. ------------------------------------------------------------------------------
  176.  
  177. FG_ALLOCEMS
  178.  
  179. Prototype
  180.  
  181.    int fg_allocems (int page_number);
  182.  
  183. Description
  184.  
  185.    The fg_allocems routine creates a logical page in expanded memory (EMS).
  186.    The amount of memory required depends on the current video mode and
  187.    video buffer dimensions.
  188.  
  189. Parameters
  190.  
  191.    page_number is the number by which the logical page will be referenced.
  192.    It must be between 1 and 63.
  193.  
  194. Return value
  195.  
  196.     0 = logical page created in expanded memory
  197.    -1 = Expanded Memory Manager not initialized
  198.    -2 = invalid page number
  199.    -3 = page already created, or page exists as a physical or virtual page
  200.    -4 = insufficient expanded memory to create the page
  201.  
  202. Restrictions
  203.  
  204.    This routine has no effect if page_number references a physical or
  205.    virtual video page.
  206.  
  207.    Before using this routine, you must use the fg_initems routine to
  208.    initialize the Expanded Memory Manager.
  209.  
  210.    The only function you can perform with EMS logical pages is copying one
  211.    entire page to another (with fg_copypage).
  212.  
  213. See also
  214.  
  215.    fg_alloccms, fg_allocxms, fg_copypage, fg_freepage, fg_initems
  216.  
  217. Examples
  218.  
  219.    8-9
  220.  
  221. ------------------------------------------------------------------------------
  222.  
  223. FG_ALLOCXMS
  224.  
  225. Prototype
  226.  
  227.    int fg_allocxms (int page_number);
  228.  
  229. Description
  230.  
  231.    The fg_allocxms routine creates a logical page in extended memory (XMS).
  232.    The amount of memory required depends on the current video mode and
  233.    video buffer dimensions.
  234.  
  235. Parameters
  236.  
  237.    page_number is the number by which the logical page will be referenced.
  238.    It must be between 1 and 63.
  239.  
  240. Return value
  241.  
  242.     0 = logical page created in extended memory
  243.    -1 = XMS driver not present
  244.    -2 = invalid page number
  245.    -3 = page already created, or page exists as a physical or virtual page
  246.    -4 = insufficient extended memory to create the page
  247.  
  248. Restrictions
  249.  
  250.    This routine has no effect if page_number references a physical or
  251.    virtual video page.
  252.  
  253.    Before using this routine, you must use the fg_initxms routine to
  254.    initialize the XMS device driver.
  255.  
  256.    The only function you can perform with XMS logical pages is copying one
  257.    entire page to another (with fg_copypage).
  258.  
  259. See also
  260.  
  261.    fg_alloccms, fg_allocems, fg_copypage, fg_freepage, fg_initxms
  262.  
  263. Examples
  264.  
  265.    8-9
  266.  
  267. ------------------------------------------------------------------------------
  268.  
  269. FG_BOX
  270.  
  271. Prototype
  272.  
  273.    void fg_box (int minx, int maxx, int miny, int maxy);
  274.  
  275. Description
  276.  
  277.    The fg_box routine draws a hollow rectangle in screen space or character
  278.    space, with respect to the clipping region.  The width of the rectangle's
  279.    edges is one pixel unless changed with the fg_boxdepth routine.
  280.  
  281. Parameters
  282.  
  283.    minx is the x coordinate of the rectangle's left edge.
  284.  
  285.    maxx is the x coordinate of the rectangle's right edge.  It must be
  286.    greater than or equal to the value of minx.
  287.    
  288.    miny is the y coordinate of the rectangle's top edge.
  289.  
  290.    maxy is the y coordinate of the rectangle's bottom edge.  It must be
  291.    greater than or equal to the value of miny.
  292.  
  293. Return value
  294.  
  295.    none
  296.  
  297. Restrictions
  298.  
  299.    This routine has no effect in text video modes
  300.  
  301. See also
  302.  
  303.    fg_boxdepth, fg_rect
  304.  
  305. Examples
  306.  
  307.    6-11, 11-7
  308.    
  309. ------------------------------------------------------------------------------
  310.  
  311. FG_BOXDEPTH
  312.  
  313. Prototype
  314.  
  315.    void fg_boxdepth (int xwidth, int ywidth);
  316.  
  317. Description
  318.  
  319.    The fg_boxdepth routine defines the depth of rectangles drawn with the
  320.    fg_box routine.  The fg_setmode routine initializes the box depth to one
  321.    pixel in each direction.
  322.  
  323. Parameters
  324.  
  325.    xdepth is the width in pixels of the rectangle's left and right sides.
  326.    It must be greater than zero.
  327.  
  328.    ydepth is the width in pixels of the rectangle's top and bottom sides.
  329.    It must be greater than zero.
  330.  
  331. Return value
  332.  
  333.    none
  334.  
  335. Restrictions
  336.  
  337.    none
  338.  
  339. See also
  340.  
  341.    fg_box
  342.  
  343. Exmaples
  344.  
  345.    6-11
  346.  
  347. ------------------------------------------------------------------------------
  348.  
  349. FG_COPYPAGE
  350.  
  351. Prototype
  352.  
  353.    void fg_copypage (int source_page, int dest_page);
  354.  
  355. Description
  356.  
  357.    The fg_copypage routine transfers the contents of one video page to
  358.    another.  The pages may be physical, virtual, or logical video pages.
  359.    The call
  360.  
  361.       fg_copypage(source,dest);
  362.  
  363.    is equivalent to
  364.  
  365.       fg_transfer(0,fg_getmaxx(),0,fg_getmaxy(),0,fg_getmaxx(),source,dest);
  366.  
  367. Parameters
  368.  
  369.    source_page is the source video page number.  It must be between 0 and 63.
  370.  
  371.    dest_page is the destination video page number.  It must be between 0 and
  372.    63.
  373.  
  374. Return value
  375.  
  376.    none
  377.  
  378. Restrictions
  379.  
  380.    If source_page and dest_page both reference logical pages, the pages must
  381.    exist in the same type of memory.  For example, you cannot copy a logical
  382.    page in extended memory to a logical page in conventional memory.
  383.  
  384. See also
  385.  
  386.    fg_alloccms, fg_allocems, fg_allocxms, fg_initems, fg_initxms, fg_transfer
  387.  
  388. Examples
  389.  
  390.    8-9, 9-22
  391.  
  392. ------------------------------------------------------------------------------
  393.  
  394. FG_DISPPCX
  395.  
  396. Prototype
  397.  
  398.    int fg_disppcx (char *filename, int flags);
  399.  
  400. Description
  401.  
  402.    The fg_disppcx routine displays an image stored in a PCX file.  The image
  403.    will be positioned such that its upper left corner is at the graphics
  404.    cursor position of the active video page.
  405.  
  406. Parameters
  407.  
  408.    filename is the name of the PCX file.  A device and path name may be
  409.    included as part of the file name.  The file name must be terminated by
  410.    a null character (that is, a zero byte).
  411.  
  412.    flags is a bit mask that controls how the image is displayed.
  413.  
  414.       Bit 0
  415.          0 = use palette values stored in the PCX file
  416.          1 = use the current palette settings
  417.  
  418.       Bits 1-15 are reserved for future use and should be zero.
  419.  
  420. Return value
  421.  
  422.    0 = success
  423.    1 = file not found
  424.    2 = file is not a PCX file
  425.  
  426. Restrictions
  427.  
  428.    PCX files are specific to certain video modes.  The table below summarizes
  429.    the compatible video modes for PCX files.
  430.  
  431.       If PCX file was         You can display
  432.       created in mode         it in these modes
  433.       ---------------         -----------------
  434.       4 or 5                  4 or 5
  435.       6 or 11                 6, 11, 13 to 18
  436.       9                       9
  437.       13 to 18                13 to 18
  438.       19                      19 to 23
  439.  
  440.    Displaying a PCX file at a lower resolution (for example, a 640x480 PCX
  441.    file at 320x200) will truncate the display on the right and on the bottom.
  442.    This effectively displays the upper left corner of the PCX file.  If you
  443.    attempt to display a PCX file in an incompatible video mode, fg_disppcx
  444.    will still display something, but it will be garbled.
  445.  
  446.    The fg_disppcx routine has no effect in text video modes or in the
  447.    Hercules low-resolution graphics mode.
  448.  
  449. See also
  450.  
  451.    fg_dispfile, fg_makepcx
  452.  
  453. Examples
  454.  
  455.    9-15
  456.  
  457. ------------------------------------------------------------------------------
  458.  
  459. FG_GETATTR
  460.  
  461. Prototype
  462.    
  463.    int fg_getattr (int row, int column);
  464.  
  465. Description
  466.  
  467.    The fg_getattr routine returns the character attribute stored at the
  468.    specified position on the active video page.
  469.  
  470. Parameters
  471.  
  472.    row is the row number of the character cell to examine, between 0 and
  473.    24 (unless you've called fg_setlines to increase the number of lines
  474.    per page).
  475.  
  476.    column is the column number of the character cell to examine, between
  477.    0 and 39 for 40-column modes, or between 0 and 79 for 80-column modes.
  478.  
  479. Return value
  480.  
  481.    The character attribute stored at the specified position.
  482.  
  483. Restrictions
  484.  
  485.    This routine has no effect in graphics video modes.
  486.  
  487. See also
  488.  
  489.    fg_getchar, fg_getimage
  490.  
  491. Examples
  492.  
  493.    7-4
  494.  
  495. ------------------------------------------------------------------------------
  496.  
  497. FG_GETCHAR
  498.  
  499. Prototype
  500.    
  501.    int fg_getchar (int row, int column);
  502.  
  503. Description
  504.  
  505.    The fg_getchar routine returns the character value stored at the specified
  506.    position on the active video page.
  507.  
  508. Parameters
  509.  
  510.    row is the row number of the character cell to examine, between 0 and
  511.    24 (unless you've called fg_setlines to increase the number of lines
  512.    per page).
  513.  
  514.    column is the column number of the character cell to examine, between
  515.    0 and 39 for 40-column modes, or between 0 and 79 for 80-column modes.
  516.  
  517. Return value
  518.  
  519.    The character value stored at the specified position.
  520.  
  521. Restrictions
  522.  
  523.    This routine has no effect in graphics video modes.
  524.  
  525. See also
  526.  
  527.    fg_getattr, fg_getimage
  528.  
  529. Examples
  530.  
  531.    7-4
  532.  
  533. ------------------------------------------------------------------------------
  534.  
  535. FG_GETDACS
  536.  
  537. Prototype
  538.  
  539.    void fg_getdacs (int start, int count, char *values);
  540.  
  541. Description
  542.  
  543.    The fg_getdacs routine retrieves the red, green, and blue color components
  544.    of a contiguous block of video DAC registers.  Each color component is a
  545.    value between 0 and 63; increasing values produce more intense colors.
  546.    Reading many DAC registers with fg_getdacs is considerably faster than
  547.    doing so individually with fg_getrgb.
  548.  
  549. Parameters
  550.  
  551.    start is the starting video DAC register number, between 0 and 255.
  552.  
  553.    count is the number of contiguous DAC registers to retrieve.  If the
  554.    sum of start and count exceeds 255, the register numbers wrap around
  555.    and resume with register number 0.
  556.  
  557.    values is the array that will receive the color components.  The first
  558.    three bytes of this array receive the red, green, and blue components
  559.    for DAC register start, the next three bytes receive the components for
  560.    register start+1, and so forth.  The size of the values array must be at
  561.    least 3*count bytes.
  562.  
  563. Return value
  564.  
  565.    none
  566.  
  567. Restrictions
  568.  
  569.    This routine has no effect in text video modes, or in any graphics video
  570.    mode numbered 16 or below (because these video modes do not use DAC
  571.    registers).
  572.  
  573. See also
  574.  
  575.    fg_getrgb, fg_setdacs, fg_setrgb
  576.  
  577. Examples
  578.  
  579.    5-12
  580.  
  581. ------------------------------------------------------------------------------
  582.  
  583. FG_GETLINES
  584.  
  585. Prototype
  586.  
  587.    int fg_getlines (void);
  588.  
  589. Description
  590.  
  591.    The fg_getlines routine returns the number of text rows per video page
  592.    for the current video mode.
  593.  
  594. Parameters
  595.  
  596.    none
  597.  
  598. Return value
  599.  
  600.    The number of text rows per video page for the current video mode.
  601.  
  602. Restrictions
  603.  
  604.    none
  605.  
  606. See also
  607.  
  608.    fg_setlines
  609.  
  610. Examples
  611.  
  612.    3-5
  613.  
  614. ------------------------------------------------------------------------------
  615.  
  616. FG_IMAGESIZ
  617.  
  618. Prototype
  619.  
  620.    long fg_imagesiz (int width, int height);
  621.  
  622. Description
  623.  
  624.    The fg_imagesiz routine determines the number of bytes required to store
  625.    a mode-specific bit-mapped image of specified dimensions.
  626.  
  627. Parameters
  628.  
  629.    width specifies the image width in pixels.
  630.  
  631.    height specifies the image height in pixels.
  632.  
  633. Return value
  634.  
  635.    The number of bytes required to store a mode-specific bit-mapped image of
  636.    the specified size in the current video mode.
  637.  
  638. Restrictions
  639.  
  640.    none
  641.  
  642. See also
  643.  
  644.    fg_clpimage, fg_drwimage, fg_flpimage, fg_getimage, fg_revimage
  645.  
  646. Examples
  647.  
  648.    9-20
  649.  
  650. ------------------------------------------------------------------------------
  651.  
  652. FG_INITEMS
  653.  
  654. Prototype
  655.  
  656.    int fg_initems (void);
  657.  
  658. Description
  659.  
  660.    The fg_initems routine initializes expanded memory (EMS) for use with
  661.    Fastgraph.
  662.  
  663. Parameters
  664.  
  665.    none
  666.  
  667. Return value
  668.  
  669.     0 = success
  670.    -1 = Expanded Memory Manager not installed or not accessible
  671.  
  672. Restrictions
  673.  
  674.    This routine requires an Expanded Memory Manager (EMM) that conforms to
  675.    the Lotus/Intel/Microsoft Expanded Memory Specification (LIM-EMS) version
  676.    3.2 or later.  On 80386 and 80486 systems, the EMM386.EXE device driver
  677.    supplied with DOS 5.0 can be used to treat some or all of extended memory
  678.    as expanded memory.
  679.  
  680.    The Expanded Memory Manager uses interrupt 67h.  As a result, this vector
  681.    is not available for application programs.
  682.  
  683. See also
  684.  
  685.    fg_allocems, fg_initxms
  686.  
  687. Examples
  688.  
  689.    8-9
  690.  
  691. ------------------------------------------------------------------------------
  692.  
  693. FG_INITXMS
  694.  
  695. Prototype
  696.  
  697.    int fg_initxms (void);
  698.  
  699. Description
  700.  
  701.    The fg_initxms routine initializes extended memory (XMS) for use with
  702.    Fastgraph.
  703.  
  704. Parameters
  705.  
  706.    none
  707.  
  708. Return value
  709.  
  710.     0 = success
  711.    -1 = XMS driver not installed or not accessible
  712.  
  713. Restrictions
  714.  
  715.    This routine requires an external device driver that conforms to the
  716.    Lotus/Intel/Microsoft/AST eXtended Memory Specification (XMS) version
  717.    2.0, such as HIMEM.SYS.  This driver requires an 80286, 80386, or 80486
  718.    system.
  719.  
  720. See also
  721.  
  722.    fg_allocxms, fg_initems
  723.  
  724. Examples
  725.  
  726.    8-9
  727.  
  728. ------------------------------------------------------------------------------
  729.  
  730. FG_MAKEPCX
  731.  
  732. Prototype
  733.  
  734.    int fg_makepcx (int minx, int maxx, int miny, int maxy, char *filename);
  735.  
  736. Description
  737.  
  738.    The fg_makepcx routine creates a PCX file from the specified rectangular
  739.    region of the active video page.  The region's extremes are expressed in
  740.    screen space units.
  741.  
  742. Parameters
  743.  
  744.    minx is the x coordinate of the region's left edge.  Its value is reduced
  745.    to a byte boundary if necessary.
  746.  
  747.    maxx is the x coordinate of the region's right edge.  It must be greater
  748.    than or equal to the value of minx.
  749.  
  750.    miny is the y coordinate of the region's top edge.
  751.  
  752.    maxy is the y coordinate of the region's bottom edge.  It must be greater
  753.    than or equal to the value of miny.
  754.  
  755.    filename is the name of the PCX file to create.  A device and path name
  756.    may be included as part of the file name.  The file name must be
  757.    terminated by a null character (that is, a zero byte).  If an identically
  758.    named file already exists, it is overwritten.
  759.  
  760. Return value
  761.  
  762.    0 = success
  763.    1 = file not created
  764.  
  765. Restrictions
  766.  
  767.    The fg_makepcx routine has no effect in text video modes or in the
  768.    Hercules low-resolution graphics mode.  Refer to the description of the
  769.    fg_disppcx routine for information about PCX file compatibility between
  770.    different video modes.
  771.  
  772.    In the Tandy/PCjr 16-color graphics mode (mode 9) and the native EGA
  773.    graphics modes (modes 13 through 16), the palette registers are not
  774.    readable.  Hence, fg_makepcx will use the default palette settings when
  775.    used in these video modes.
  776.  
  777. See also
  778.  
  779.    fg_disppcx
  780.  
  781. Examples
  782.  
  783.    9-15
  784.  
  785. ------------------------------------------------------------------------------
  786.  
  787. FG_MAPRGB
  788.  
  789. Prototype
  790.  
  791.    int fg_maprgb (int red, int green, int blue);
  792.  
  793. Description
  794.  
  795.    The fg_maprgb routine maps six-bit red, green, and blue color components
  796.    into a suitable palette value for the current video mode.  You can then
  797.    pass this value to the fg_palette routine.
  798.  
  799. Parameters
  800.  
  801.    red, green, and blue respectively specify the color's red, green, and blue
  802.    components.  These values must be between 0 and 63; increasing values
  803.    produce more intense colors.
  804.  
  805. Return value
  806.  
  807.    The mode-specific palette value for the specified color components.
  808.  
  809. Restrictions
  810.  
  811.    This routine is meaningful only in 16-color graphics video modes.
  812.  
  813. See also
  814.  
  815.    fg_palette, fg_palettes, fg_setrgb
  816.  
  817. Examples
  818.  
  819.    5-13
  820.  
  821. ------------------------------------------------------------------------------
  822.  
  823. FG_RESIZE
  824.  
  825. Prototype
  826.  
  827.    void fg_resize (int width, int height);
  828.  
  829. Description
  830.  
  831.    The fg_resize routine changes the dimensions of a video page in EGA and
  832.    VGA graphics modes.
  833.  
  834. Parameters
  835.  
  836.    width specifies the new video page width in pixels.
  837.  
  838.    height specifies the new video page height in pixels.
  839.  
  840. Return value
  841.  
  842.    none
  843.  
  844. Restrictions
  845.  
  846.    The size of a video page is constrained only by the amount of memory on
  847.    your video adapter.  Increasing the size of a video page proportionally
  848.    reduces the number of physical pages available.  For example, increasing
  849.    the page size from 320 x 200 to 640 x 400 decreases the number of video
  850.    pages from 8 to 2.
  851.  
  852.    When you call fg_resize, the visual page must be page 0.
  853.  
  854.    If you have created any virtual or logical video pages, you must release
  855.    them with fg_freepage before calling fg_resize, and then create them
  856.    again afterward.
  857.  
  858.    If you have initialized the mouse (with fg_mouseini), joysticks (with
  859.    fg_initjoy), expanded memory (with fg_initems), or extended memory (with
  860.    fg_initxms), you should call re-initialize these resources after calling
  861.    fg_resize.  Most mouse drivers expect a fixed video page width, so the
  862.    mouse cursor may become distorted after resizing video pages.
  863.  
  864.    The fg_setmode routine re-establishes the dimensions of a video page to
  865.    the default resolution for the selected video mode.
  866.  
  867.    This routine is meaningful only in the native EGA graphics modes (13 to
  868.    16), native VGA graphics modes (17 and 18), and extended VGA graphics
  869.    modes (20 to 23).  It has no effect in other video modes.
  870.  
  871. See also
  872.  
  873.    fg_pan
  874.  
  875. Examples
  876.  
  877.    8-10, 11-7
  878.  
  879. ------------------------------------------------------------------------------
  880.  
  881. FG_RESUME
  882.  
  883. Prototype
  884.  
  885.    void fg_resume (void);
  886.  
  887. Description
  888.  
  889.    The fg_resume routine restarts asynchronous music previously suspended
  890.    by the fg_suspend routine.  It has no effect if there is no suspended
  891.    music.
  892.  
  893. Parameters
  894.  
  895.    none
  896.  
  897. Return value
  898.  
  899.    none
  900.  
  901. Restrictions
  902.  
  903.    none
  904.  
  905. See also
  906.  
  907.    fg_musicb, fg_suspend
  908.  
  909. Examples
  910.  
  911.    13-8
  912.  
  913. ------------------------------------------------------------------------------
  914.  
  915. FG_SETDACS
  916.  
  917. Prototype
  918.  
  919.    void fg_setdacs (int start, int count, char *values);
  920.  
  921. Description
  922.  
  923.    The fg_setdacs routine defines the values of a block of contiguous video
  924.    DAC registers by specifying their red, green, and blue color components.
  925.    Defining many DAC registers with fg_setdacs is considerably faster than
  926.    doing so individually with fg_setrgb.
  927.  
  928. Parameters
  929.  
  930.    start is the starting video DAC register number, between 0 and 255.
  931.  
  932.    count is the number of contiguous DAC registers to define.  If the
  933.    sum of start and count exceeds 255, the register numbers wrap around
  934.    and resume with register number 0.
  935.  
  936.    values is the array containing the color components.  The first three
  937.    bytes of this array must contain the red, green, and blue components
  938.    for DAC register start, the next three bytes contain the components for
  939.    register start+1, and so forth.  The size of the values array must be at
  940.    least 3*count bytes.
  941.  
  942. Return value
  943.  
  944.    none
  945.  
  946. Restrictions
  947.  
  948.    This routine has no effect in text video modes, or in any graphics video
  949.    mode numbered 16 or below (because these video modes do not use DAC
  950.    registers).
  951.  
  952. See also
  953.  
  954.    fg_getdacs, fg_getrgb, fg_setrgb
  955.  
  956. Examples
  957.  
  958.    5-12
  959.  
  960. ------------------------------------------------------------------------------
  961.  
  962. FG_SETLINES
  963.  
  964. Prototype
  965.  
  966.    void fg_setlines (int lines);
  967.  
  968. Description
  969.  
  970.    The fg_setlines routine extends an 80-column text mode to 25, 43, or 50
  971.    lines per screen.  The fg_setmode routine sets the number of lines to 25
  972.    when establishing an 80-column text mode.
  973.  
  974. Parameters
  975.  
  976.    lines is the number of text rows per screen.  On EGA systems, the value
  977.    of lines must be 25 or 43.  On MCGA systems, it must be 25 or 50.  On VGA
  978.    systems, it must be 25, 43, or 50.   Any other value is ignored.  Before
  979.    calling fg_setlines, you should call fg_testmode with pages=0 to see if
  980.    the user's system supports the number of rows needed.
  981.  
  982. Return value
  983.  
  984.    none
  985.  
  986. Restrictions
  987.  
  988.    This routine is only meaningful when running in 80-column text modes on
  989.    EGA or VGA systems (in other cases it does nothing).
  990.  
  991.    When you call fg_setlines, the visual page must be page 0.
  992.  
  993.    Calling fg_setlines makes the text cursor visible.
  994.  
  995.    If you have initialized the mouse (with fg_mouseini), joysticks (with
  996.    fg_initjoy), expanded memory (with fg_initems), or extended memory (with
  997.    fg_initxms), you should call re-initialize these resources after calling
  998.    fg_setlines.
  999.  
  1000. See also
  1001.  
  1002.    fg_getlines, fg_testmode
  1003.  
  1004. Examples
  1005.  
  1006.    3-5
  1007.  
  1008. ------------------------------------------------------------------------------
  1009.  
  1010. FG_SUSPEND
  1011.  
  1012. Prototype
  1013.  
  1014.    void fg_suspend (void);
  1015.  
  1016. Description
  1017.  
  1018.    The fg_suspend routine suspends asynchronous music previously started
  1019.    by the fg_musicb routine.  It has no effect if there is no asynchronous
  1020.    music in progress.
  1021.  
  1022. Parameters
  1023.  
  1024.    none
  1025.  
  1026. Return value
  1027.  
  1028.    none
  1029.  
  1030. Restrictions
  1031.  
  1032.    A program must not exit to DOS with music suspended.  You must call
  1033.    fg_hush to cancel the music first.
  1034.  
  1035. See also
  1036.  
  1037.    fg_hush, fg_musicb, fg_resume
  1038.  
  1039. Examples
  1040.  
  1041.    13-8
  1042.  
  1043. ------------------------------------------------------------------------------
  1044.              Optimizations and improvements to existing routines
  1045. ------------------------------------------------------------------------------
  1046.  
  1047. In video modes that offer virtual pages, Fastgraph now allows up to 64 pages
  1048. instead of 16.  Usually, the amount of RAM available on your system will
  1049. limit the number of virtual pages to a smaller number, however.
  1050.  
  1051. Video modes 20 and 21 are as much as 16 times faster than in Fastgraph
  1052. version 2.00 and 2.01.  In fact, mode 20 is now three to four times faster
  1053. than mode 19.
  1054.  
  1055. Graphics in the native EGA and VGA modes (modes 13 to 18) are considerably
  1056. faster when the mouse is active.
  1057.  
  1058. The fg_clpimage and fg_flpimage routines no longer extend the clipping limits
  1059. to byte boundaries in the native EGA and VGA graphics modes.  These routines
  1060. now clip to the exact limits specified in fg_setclip.
  1061.  
  1062. The fg_dispfile routine now displays any size pixel run file.  Previously,
  1063. pixel run files were limited to 64K bytes.
  1064.  
  1065. The fg_freepage routine releases virtual pages or logical pages.  Logical
  1066. pages may be in conventional memory, expanded memory (EMS), or extended
  1067. memory (XMS).
  1068.  
  1069. The fg_getmap routine in the large model libraries now works properly in
  1070. video modes 20 and 21.
  1071.  
  1072. The fg_rect and fg_clprect routines are nearly twice as fast in the native
  1073. EGA and VGA graphics modes than in previous versions.
  1074.  
  1075. The fg_tcxfer routine is over eight times faster in the native EGA and VGA
  1076. graphics modes than in previous versions.
  1077.  
  1078. The 640x480 VGA graphics modes (17 and 18) formerly offered one physical page
  1079. and no virtual pages.  These modes now offer a partial second partial page
  1080. (page 1) containing 320 pixel rows.  However, you cannot use the fg_setvpage
  1081. or the fg_text routines on the partial video page.
  1082.  
  1083. Fastgraph no longer uses interrupt 64h.
  1084.  
  1085. Other miscellaneous code optimizations have been applied to several Fastgraph
  1086. routines.
  1087.  
  1088. ------------------------------------------------------------------------------
  1089.                                 EDITSPR utility
  1090. ------------------------------------------------------------------------------
  1091.  
  1092. The EDITSPR utility changes all pixel runs of one color to another color in
  1093. an image file stored in Fastgraph's standard pixel run (.SPR) format.  The
  1094. syntax of the command for invoking the EDITSPR utility from the DOS command
  1095. prompt is
  1096.  
  1097.                         EDITSPR <input_file> <output_file>
  1098.  
  1099. where <input_file> is the name of the original image file, and <output_file>
  1100. is the name of the new image file.  EDITSPR does not modify the <input_file>
  1101. in any way, but it will overwrite the <output_file> if an identically named
  1102. file exists in the current directory.
  1103.  
  1104. After it reads the pixel runs from the <input_file>, EDITSPR will perform the
  1105. requested color changes.  It does this iteratively by asking for an old color
  1106. value followed by a new color value (each value must be between 0 and 255).
  1107. EDITSPR then finds the pixel runs of the old color value and changes them to
  1108. the new color value.  Following this, EDITSPR displays a message stating how
  1109. many pixel runs it changed.  This process repeats until you enter a negative
  1110. number for either color value.
  1111.  
  1112. EDITSPR will next combine adjacent pixel runs of like colors.  For example,
  1113. suppose the original image file contained a color 1 pixel run of length 50,
  1114. followed by a color 2 pixel run of length 20, followed by another color 1
  1115. pixel run of length 10.  If you changed all color 2 pixel runs to color 1,
  1116. EDITSPR will combine these three pixel runs into a single run of length 80.
  1117.  
  1118. Finally, EDITSPR will close the <output_file>.
  1119.  
  1120. ------------------------------------------------------------------------------
  1121.                                 GrabRGB utility
  1122. ------------------------------------------------------------------------------
  1123.  
  1124. The GrabRGB utility is a terminate and stay resident program (TSR) to capture
  1125. the current red, green, and blue color components of video DAC registers in
  1126. the 256-color MCGA and VGA graphics modes.  You can use GrabRGB together with
  1127. Fastgraph's SNAPSHOT utility to preserve the original colors of a captured
  1128. image (for more information on SNAPSHOT, see Appendix A of the "Fastgraph
  1129. User's Guide").
  1130.  
  1131. To load GrabRGB, just enter the command GRABRGB at the DOS prompt.  After
  1132. GrabRGB loads, control returns to the DOS prompt.  At this point, you can use
  1133. any method whatsoever to display a 256-color graphic image and then press the
  1134. Alt and right shift keys at the same time to capture the current DAC
  1135. settings.  You don't need to load GrabRGB for each image, just once per
  1136. system boot.  GrabRGB uses about 15,000 bytes of conventional memory once
  1137. loaded.
  1138.  
  1139. To illustrate the use of GrabRGB, suppose you have drawn and saved a
  1140. 256-color image with a commercial paint program, and you want to incorporate
  1141. this image into a Fastgraph application.  Once you load SNAPSHOT and GrabRGB,
  1142. activate the paint program and retrieve your image.  Then press the Alt and
  1143. left shift keys to capture the image with SNAPSHOT.  After SNAPSHOT's success
  1144. tone (three quick medium-pitched sounds), press Alt and right shift to
  1145. capture the RGB components of each DAC register with GrabRGB, and wait for
  1146. GrabRGB's success tone.  Finally, exit the paint program and return to the
  1147. DOS prompt.
  1148.  
  1149. The sequence described in the preceding paragraph will write the RGB color
  1150. components for each DAC register to a file named GRABRGB.nnn in the current
  1151. directory.  The file type "nnn" will be the first sequence of digits that
  1152. does not result in a duplicate file name.  That is, if there are no GrabRGB
  1153. output files in the current directory, GrabRGB will use the file name
  1154. GRABRGB.000.  The next time you use GrabRGB, it will store the RGB
  1155. information in GRABRGB.001, then GRABRGB.002, and so forth.  If you rename or
  1156. delete one of these files, GrabRGB will again use that file name.  For
  1157. example, if you delete GRABRGB.000 but keep GRABRGB.001, GrabRGB will next
  1158. use the file name GRABRGB.000.
  1159.  
  1160. If for some reason GrabRGB is unable to obtain the RGB components of each DAC
  1161. register, it will produce its error tone (a single low-pitched sound).  The
  1162. most common cause of this is trying to capture an image from a text video
  1163. mode, or from a graphics video mode with fewer than 256 colors.  It will also
  1164. occur if there is insufficient disk space or if all 1,000 output file names
  1165. are already being used.
  1166.  
  1167. Each line in the output file created by GrabRGB is of the form:
  1168.  
  1169.    nnn,rr,gg,bb,
  1170.  
  1171. where "nnn" is a DAC register index (between 0 and 255), "rr" is the red
  1172. component of that DAC register, "gg" is the green component, and "bb" is the
  1173. blue component.  Each color component is between 0 and 63.  You can edit and
  1174. reformat these lines as necessary for inclusion in a C initializer list, a
  1175. QuickBASIC or FORTRAN data statement, or a Turbo Pascal array-type constant
  1176. list.  Such an array of RGB components, but without the "nnn" indices, is in
  1177. the format expected by fg_getdacs.
  1178.  
  1179. By default, GrabRGB captures information for all 256 DAC registers.  If you
  1180. want to consider only the DAC registers with color components different from
  1181. their original values, just include the /D option when you load GrabRGB
  1182. (that is, use the command GRABRGB /D).  If you specify the /D option and all
  1183. 256 DACs use their default values, the output file will contain a message
  1184. stating this.
  1185.  
  1186. ------------------------------------------------------------------------------
  1187.                                 HERCFIX utility
  1188. ------------------------------------------------------------------------------
  1189.  
  1190. The HERCFIX utility allows you to use SNAPSHOT (and perhaps other TSRs) with
  1191. programs that do not update the BIOS data area when establishing the 720x348
  1192. Hercules graphics mode.  If you use SNAPSHOT with such a program, SNAPSHOT
  1193. will think the monochrome text mode (video mode 7) is active and will produce
  1194. its low-pitched error tone when activated.
  1195.  
  1196. If this occurs, use HERCFIX to load the application from which you are trying
  1197. to capture the image.  To do this, enter
  1198.  
  1199.         HERCFIX <command>
  1200.  
  1201. at the DOS prompt, where <command> is the command line that activates the
  1202. application.  For example, suppose you use the command line "PAINTER /H" to
  1203. run a commercial paint program in Hercules graphics mode.  To load the paint
  1204. program with HERCFIX, you would enter the command "HERCFIX PAINTER /H".
  1205.  
  1206. For complete information about SNAPSHOT, please refer to Appendix A of the
  1207. Fastgraph User's Guide.
  1208.